home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d918.lha / MultiPlot / Docs / HPGL2ps.doc next >
Text File  |  1993-10-04  |  8KB  |  231 lines

  1.                                HPGL2PS
  2.  
  3.          A HP (Hewlet Packard) plot command filter to PostScript
  4.                       for the Commodore Amiga
  5.  
  6.               Ported 7/8/1990 by Dr Alan G Baxter
  7.                 Walter & Eliza Hall Institute,
  8.                   Parkville 3053, AUSTRALIA
  9.  
  10.  
  11. Not all the commands of HPGL are implemented (approx 95% are) and
  12. those commands that are not are skipped and a warning given.
  13. It is very easy to add to this filter if a particular unimplemented
  14. command is desired.
  15.  
  16. SYNOPSIS
  17.  
  18. hpgl2ps
  19.      [-A | B | 4 | 3]
  20.      [-m]
  21.      [-r]
  22.      [-l line sizes]
  23.      [-s scale]
  24.      [-x offset]
  25.      [-y offset]
  26.      [-h font height multiplier]
  27.      [-w font width multiplier]
  28.      [plotfile]
  29.  
  30.  
  31. DESCRIPTION
  32. This filter is used to convert Hewlet Packard Graphic Language (HP-GL)
  33. 7550A plotter commands to PostScript. The HP-GL commands are a subset of the
  34. Roland plotter command set (RD-GL).
  35.  
  36. The default conditions for hpgl2ps are:
  37.  
  38. A. The plot translation is from an ANSI A (8.5 x 11inch) plot to ANSI A
  39. paper on the LaserWriter.  See below for other paper sizes.
  40.  
  41. B. Line thicknesses are in millimeters and are for lines (pens) 1 to 9:
  42. ( 0.4, 0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2 )
  43.  
  44. C. The default font is Helvetica, 14 point on the Laserwriter.
  45.  
  46. D. The default font height and width multipliers are 1.2 and 3.6 respectively.
  47.  
  48. Note:
  49. If the ouput is not redirected then standard output is assumed.
  50.  
  51.  
  52. ARGUMENTS
  53.  
  54. -A Draw for an ANSI A (11 x 8.5inch) plot.
  55.  
  56. -B Draw for an ANSI B (17 x 11inch) plot.
  57.  
  58. -4 Draw for an A4 ISO (297mm x 210mm) plot. This will give an
  59.     aproximate 1:1 translation to the LaserWriter.
  60.  
  61. -3 Draw for an A3 ISO (420mm x 297mm) plot.
  62.  
  63. -l line sizes
  64.    This option allows the default line sizes to be replaced with different
  65. sizes starting from line (pen) one through nine. The new sizes (real or
  66. integer) are entered in a comma seperated string (line size) and
  67. are in millimeters. Only the sizes entered in the string will be
  68. changed with respect to lines (pens) one to nine while nonentered line
  69. (pen) sizes will retain the default sizes.
  70.    In the following example only the first three sizes will be changed.
  71.  
  72.    eg: hpgl2ps -l0.4,0.3,1 file
  73.  
  74. -m Enable the manual feed on the LaserWriter (cutoff time 3 minutes).
  75.  
  76. -r Rotate plot(s) through 90 degrees. (Aspect ratio distorted)
  77.  
  78. -s scale
  79.     Scale the plot from 0.1 to 3 times its original size.
  80.  
  81. -w relative font width multiplier
  82.      When the SR command exists in the HP-GL file, the size of
  83. characters is scaled to be a proportion of the paper dimensions.
  84. The HP7550 plotter character sizes are larger than the scaling suggests.
  85. The default value of the font width multiplier scales the characters in the
  86. postscript file to appear roughly the same width as the original.
  87. Setting to 1.0 reverts to the original scaling.
  88.  
  89. -w relative font height multiplier
  90.      When the SR command exists in the HP-GL file, the size of characters
  91. is scaled to be a proportion of the paper dimensions.   The HP7550 plotter
  92. character sizes are larger than the scaling suggests.  The default
  93. value of the font height multiplier scales the characters in the
  94. postscript file to appear roughly the same width as the original.
  95. Setting to 1.0 reverts to the original scaling.
  96.  
  97. -x offset
  98.     Place an X offset (in mm) in the plot.
  99.  
  100. -y offset
  101.     Place an Y offset (in mm) in the plot.
  102.  
  103. Note: Offsets are with respect to the 0, 0 (origin) of the HP-GL
  104. / RD-GL plotting commands, thus if the minimum plotting coordinates are
  105. below either the X and/or Y zero axis then a positive offset is
  106. applied.  Similarly if the minimum plot coordinates are above the X
  107. and/or Y zero axis then a negative offset is applied.
  108.  
  109. AUTHOR
  110. Don McCormick
  111. CSIRO
  112. Division of Applied Physics
  113. PO 218, Lindfield, N.S.W., 2070
  114. Australia
  115.  
  116. Scaling, Tick Marks, and other modifications by:
  117. Gordon Jacobs, University of California, Berkeley
  118.  
  119. Amiga port, RO command support, by:
  120. Alan Baxter, Walter & Eliza Hall Institute, Melbourne
  121.  
  122. BUGS
  123. Some of the graphics commands are unimplemented and a warning will be
  124. displayed. If this command is vital then it must be written into the code.
  125.  
  126. No interactive command is suported.
  127.  
  128.  
  129. -------------------------
  130. Notes on first enhancement:
  131.  
  132. Support for user defined characters added by
  133. Gerald William Kokodyniak B.A.Sc. M.A.Sc.
  134. University of Toronto, Department of Mechanical Engineering
  135.  
  136. -------------------------
  137. Notes on second enhancement:
  138. Support for Scaling, tickmarks, and better user defined characters
  139. added by Gordon Jacobs, (Ph.D., since we're into titles above)
  140. University of California, Berkeley in July 1989.
  141.  
  142. Mods were made ONLY for the hpgl2ps program and are not guaranteed
  143. to work for dxy2ps.  HP-GL code from the Tektronix DSA 602
  144. Digitizing Signal Analyzer (scope) were used as a test.
  145. Laserwriter output was compared directly with plots from a
  146. HP7550A plotter reading the same HP-GL file.
  147.  
  148. Support for scaling was added.
  149. The Scaling involves re-setting the coordinate
  150. system by re-calculating the XSCALE and YSCALE numbers and adding
  151. an offset to the origin.  The offset had to be added to all files
  152. that make use of the scaling parameters.
  153.  
  154. Tick marks were added with tick.c.  Uses relative draw commands
  155. to make the tick marks and adds two global variables which are
  156. the tick length as a percentage of the overall dimensions.
  157.  
  158. The parser was changed.  The SIGNED_NUMERIC macro recognized a comma
  159. as a valid character which does not make sense.  The HP-GL code from
  160. the DSA 602 often contains a mnemonic followed by a comma, but with
  161. no parameters.  This is valid code although most sources will not
  162. place a comma unless optional parameters actually follow.  The comma
  163. was removed as a valid SIGNED_NUMERIC character and the function
  164. getval() was modified to read all trailing commas and spaces.  In
  165. this way the parser works for both the standard and odd case
  166. mentioned above.
  167.  
  168. The user defined character routine was modified heavily.  Original
  169. function did not take into account the angle of characters.  The
  170. new function reads the current angle of characters and orients
  171. the user defined character in the same way.  The scaling, which was
  172. originally huge for some reason now is dynamically set to a
  173. proportion of the size of regular text character.  The linewidth
  174. of the user defined character is arbitrarily set to 0.25mm and
  175. then the restored to the previous value.  This width seems to fit
  176. the "linewidth" of the characters in the postscript helvetica
  177. font sized for the DSA 602 output.
  178.  
  179. The default paper size is changed to be 8.5 x 11 inch paper with
  180. command line options added to support all others.
  181.  
  182. The command line options -w and -h were added because the relative
  183. scaling of fonts with the "SR" HP-GL command, while implemented
  184. correctly, gives much smaller character sizes than the HP7550A plotter.
  185. The defaults were set empirically to match plotter output.
  186.  
  187. The sizes in viewport.c were modified to get correct positioning
  188. on the 8.5 x 11 paper when compared to a plot directly from the
  189. HP7550A on the same type of paper.
  190.  
  191. The textps() routine was modified to move the position pointers to
  192. the end of a string when a string is drawn.  This was commented out
  193. in the code that I received, but needed to be restored for the
  194. user defined character to be in the correct place.  The results
  195. match the HP plotter for the same code.
  196.  
  197. --------------------------
  198. Notes on third enhancement:
  199.  
  200. I have written some test procedures for the testing of each filter they
  201. are "test1.hpgl" for hpgl2ps and "test1.dxy" for dxy2ps.
  202.  
  203. Don McCormick.
  204.  
  205.  
  206. ----------------------------
  207. Notes on Amiga Port:
  208.  
  209. Due to the vagarities of the CLI, the argument flag '-' must be
  210. immediately followed by the argument, unlike the UNIX version in
  211. which a space is allowed.
  212.  
  213. The line types have been made to repeat their pattern every 3.25mm to
  214. more closely represent the HPGL output of Multiplot.
  215.  
  216. The line widths have been changed to suit Multiplot.
  217.  
  218. The stderr output has been redirected to NIL: to avoid unwanted error
  219. messages in Multiplot. Delete main.c and link without main.o to
  220. return stderr to the current CLI.
  221.  
  222. The automatic scaling with maintainence of aspect ratio in portrait mode
  223. has been removed. It was very nice, but not right!
  224.  
  225. Support for the RO90; and RO0; commands has been added. This required
  226. major changes in hpglcom.c, viewport.c and plotcoords.c.
  227.  
  228. Alan Baxter
  229.  
  230.  
  231.